﻿using Abp.Authorization.Users;
using Abp.AutoMapper;
using AutoMapper;
using FwProject.Authorization.Users;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace FwProject.Users.Dto
{
    [AutoMap(typeof(User))]
    public class UserEnterDto
    {
        [Display(Name="所属工厂")]
        public Guid? FactoryinfoId { get; set; }

        [IgnoreMap]
        [Display(Name="工厂名称")]
        public string FactoryinfoName { get; set; }
        //[Required]
        //[StringLength(AbpUserBase.MaxUserNameLength)]
        //[Display(Name = "用户名")]
        //public string UserName { get; set; }

        [Required(ErrorMessage ="{0}不能为空")]
        [StringLength(AbpUserBase.MaxNameLength, ErrorMessage = "不能超过{1}个字符")]
        [Display(Name = "姓名")]
        public string Name { get; set; }

        //[Required]
        //[StringLength(AbpUserBase.MaxSurnameLength)]
        //[Display(Name = "姓")]
        //public string Surname { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [EmailAddress(ErrorMessage ="请输入正确的邮箱")]
        [StringLength(AbpUserBase.MaxEmailAddressLength, ErrorMessage = "不能超过{1}个字符")]
        [Display(Name = "邮箱")]
        public string EmailAddress { get; set; } = $"123{System.DateTime.Now.ToString("yyyymmddhhmmss")}@oa.com";

        [Display(Name="角色")]
        public string[] RoleNames { get; set; }

        [Display(Name = "当前地址")]
        public string NowAddress { get; set; }

        [StringLength(AbpUserBase.MaxPlainPasswordLength, ErrorMessage = "不能超过{1}个字符")]
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "手机号码")]
        public string Mobile { get; set; }

        [Display(Name = "用户类型")]
        public EmployeeType EmployeeType { get; set; }
    }
}
